package cn.iocoder.yudao.module.yyzx.dal.mysql.service;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.yyzx.dal.dataobject.service.ServiceDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.yyzx.controller.admin.service.vo.*;

/**
 * 服务关注 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface ServiceMapper extends BaseMapperX<ServiceDO> {

    default PageResult<ServiceDO> selectPage(ServicePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ServiceDO>()
                .eqIfPresent(ServiceDO::getRemarks, reqVO.getRemarks())
                .eqIfPresent(ServiceDO::getDelFlag, reqVO.getDelFlag())
                .eqIfPresent(ServiceDO::getEldenId, reqVO.getEldenId())
                .eqIfPresent(ServiceDO::getServiceid, reqVO.getServiceid())
                .eqIfPresent(ServiceDO::getAmount, reqVO.getAmount())
                .betweenIfPresent(ServiceDO::getBuytime, reqVO.getBuytime())
                .betweenIfPresent(ServiceDO::getMaturitytime, reqVO.getMaturitytime())
                .eqIfPresent(ServiceDO::getOtherinfo, reqVO.getOtherinfo())
                .betweenIfPresent(ServiceDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ServiceDO::getId));
    }

}